﻿using Silent.MDB.Common.Data;
using Silent.MDB.Common.Services;
using Silent.WCF.Base;

namespace Silent.MDB.Application.Core.Services
{
    public class ClientServiceManager : ClientServiceManagerBase
    {
        private readonly string m_host;
        private readonly int m_port;

        public ClientServiceManager(string host, int port)
        {
            m_host = host;
            m_port = port;
        }

        public override void Initialize()
        {
            AddService(new ClientServiceBuilder<ISystemInfoService>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<RootObject>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Folder>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Person>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Student>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Teacher>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Department>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Cathedra>>().Build(m_host, m_port));
            AddService(new ClientServiceBuilder<IRepositoryService<Faculty>>().Build(m_host, m_port));
        }
    }
}
